﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GcmpRenderingInterface.h"
#include "IEventArgs.h"

namespace gcmp
{
    class ICamera;

    /// \brief CameraChanged事件类型
    enum class CameraChangedEventType : int32_t
    {
        UnknownType = 0,    ///< 默认未知类型，触发警告
        CameraChanged = 1,  ///< 相机平移或旋转都会触发
        ZoomAll = 2,        ///< 在Canvas内缩放全部会触发
        ZoomToBox = 3,      ///< 缩放到包围盒(AABB Box)会触发
        ZoomToTiltBox = 4,  ///< 缩放到紧包围盒(局部坐标包围盒)会触发
    };

    /// \brief 相机事件参数接口
    class GCMP_RENDERING_INTERFACE_EXPORT ICameraChangedEventArgs : public IEventArgs
    {
    public:
        /// \brief 获取CameraChanged事件类型
        ///
        /// \return CameraChanged事件类型
        virtual CameraChangedEventType GetType() const = 0;

        /// \brief 获取相机指针
        ///
        /// \return 相机指针
        virtual const ICamera* GetCamera() const = 0;

        /// \brief 获取是否是中键平移引起的相机改变
        ///
        /// \return true表示中键平移，false表示非中键平移引起的相机改变
        virtual bool IsMiddlePan() const = 0;
    };
}

